program circles;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  x0,y0,x1,y1,r,r1,r2: integer;
  a1,b1,c1,a2,b2,c2:real;
begin
  readln(x0);
  readln(y0);
  writeln('--------------------------------------------------');
  readln(x1);
  readln(y1);
  writeln('--------------------------------------------------');
  readln(r1);
  writeln('--------------------------------------------------');
  readln(r2);
  writeln('==================================================');
  if (sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0))>r1+r2) then
  begin
    r:=r1+r2;
    b1:=round(100*(-r*(y0-y1)+sqrt(r*r*(y0-y1)*(y0-y1)-((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1))*(r*r-(x0-x1)*(x0-x1))))/((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1)))/100;
    b2:=round(100*(-r*(y0-y1)-sqrt(r*r*(y0-y1)*(y0-y1)-((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1))*(r*r-(x0-x1)*(x0-x1))))/((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1)))/100;
    a1:=round(100*(sqrt(1-b1*b1)))/100;
    a2:=round(100*(sqrt(1-b2*b2)))/100;
    c1:=-(a1*x0+b1*x0)-r1;
    c2:=-(a2*x0+b2*x0)+r1;
    writeln(a1,'*x+',b1,'*y+',c1);
    writeln(a2,'*x+',b2,'*y+',c2);
    readln;
    r:=abs(r1-r2);
    b1:=round(100*(-r*(y0-y1)+sqrt(r*r*(y0-y1)*(y0-y1)-((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1))*(r*r-(x0-x1)*(x0-x1))))/((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1)))/100;
    b2:=round(100*(-r*(y0-y1)-sqrt(r*r*(y0-y1)*(y0-y1)-((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1))*(r*r-(x0-x1)*(x0-x1))))/((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1)))/100;
    a1:=round(100*(sqrt(1-b1*b1)))/100;
    a2:=round(100*(sqrt(1-b2*b2)))/100;
    c1:=-(a1*x0+b1*x0)-r1;
    c2:=-(a2*x0+b2*x0)+r1;
    writeln(a1,'*x+',b1,'*y+',c1);
    writeln(a2,'*x+',b2,'*y+',c2);
    readln;
  end
  else
    writeln('NO');
  readln;

  { TODO -oUser -cConsole Main : Insert code here }
end.
 